package cn.song.dto;

import cn.song.Utils.Date2Long;
import cn.song.domain.OrderDetail;
import cn.song.enums.OrderStatusEnum;
import cn.song.enums.PayStatusEnum;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrderDto {

    private  String  orderId;

    // 买家姓名
    private String buyerName;

    private String buyerPhone;

    private String buyerAddress;

    private String buyerOpenid;

    //订单金额
    private BigDecimal orderAmount;

    //订单状态
    private Integer orderStatus= OrderStatusEnum.NEW.getCode();

    // 支付状态
    private Integer payStatus = PayStatusEnum.WAIT.getCode();

    @JsonSerialize(using = cn.song.Utils.Date2Long.class)
    private Date createTime;

    @JsonSerialize(using = cn.song.Utils.Date2Long.class)
    private Date updateTime;

    private List<OrderDetail> orderDetails;


}
